<?php
require_once WEB_ROOT. '/application/library/Bus.php';

class Bus_Action extends Bus {
    protected $_name = "actions";
    
    protected function _init() {
        
    }  
    
    public function getItemById($id){
        $Dtos = $this->select(array(
            'fields' => array(),
            'where'  => "idactions='{$id}'"
        ));
        if(count($Dtos) > 0){
            return $Dtos[0];
        }
        return false;
    }
    
    public function getItemByName($name){
        $Dtos = $this->select(array(
            'fields' => array(),
            'where'  => "actions_name='{$name}'"
        ));
        if(count($Dtos) > 0){
            return $Dtos;
        }
        return false;
    }
    
    public function getItemByName_And_IdMod($name, $idmod){
        $Dtos = $this->select(array(
            'where'  => "actions_name='{$name}' AND 	modules_idmodules='{$idmod}'"
        ));
        if(count($Dtos) > 0){
            return $Dtos[0];
        }
        return false;
    }
}
?>